<!--列表组件：动态决定一行显示1列还是两列，动态决定标题前是否显示*-->
<template>
  <div class="extra-info">
    <div
      :class="item.showTwo ? 'two center' : 'one center'"
      v-for="(item, index) in quotationConfirm"
      :key="index"
    >
      <label class="label">
        <i v-if="item.require">*</i> {{ item.name }}:
      </label>
      <div :style="{ flex: '0 50 auto' }">
        <!-- <el-image
				 class="image-wrap"
					v-if="item.detailInfo !== null && item.showimg"
					style="width: 100px; height: 100px"
					:src="item.detailInfo"
					 fit="fill"
					:preview-src-list="[item.detailInfo]"
					@load='imageLoad'
					:z-index="3000"
					>
				  </el-image> -->
        <a
          v-if="item.detailInfo !== null && item.showimg"
          target="_blank"
          style="color: blue"
          @click="centerDialogVisible1 = true"
          >点击查看</a
        >

        <!-- <el-image
          v-if="item.detailInfo !== null && item.showimg "
          style="width: 100px; height: 100px"
          :src="item.detailInfo"
          fit="fill"></el-image> -->

        <p v-else class="p">{{ item.detailInfo }}</p>
      </div>

      <el-dialog
      v-if="item.detailInfo !== null && item.showimg"
      :visible.sync="centerDialogVisible1"
      width="50%"
      center
      append-to-body
    >
      <el-image
        v-if="item.detailInfo !== null && item.showimg"
        style="width: 100%; height: 100%"
        :src="item.detailInfo"
        fit="fill"
      ></el-image>
      <span slot="footer" class="dialog-footer">
      </span>
    </el-dialog>
    </div>
 
  </div>
</template>

<script>
export default {
  data() {
    return {
      centerDialogVisible1: false,
    };
  },
  name: "quotationConfirm",
  props: {
    quotationConfirm: {
      type: Array,
      require: true,
    },
  },
  mounted() {},
  methods: {
    imageLoad() {},
  },
};
</script>

<style lang="scss" scoped>
.extra-info {
  width: 100%;
  display: flex;
  flex-wrap: wrap;

  .one {
    width: 100%;
  }

  .two {
    width: 50%;
  }
}

.label {
  width: 160px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  color: #666;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: 10px;

  > i {
    color: #f00;
  }
}

.p {
  font-size: 14px;
  color: #666;
  /* overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis; */
}

.center {
  display: flex;
  align-items: center;
  min-height: 40px;
}
</style>
